const bcrypt = require("bcryptjs");
const salt = 10;
//将原始密码转成hash
function hash(value) {
  return bcrypt.hashSync(value, salt);
}
//将原始密码和hash进行比较
function compare(value, hash) {
  return bcrypt.compareSync(value, hash);
}
module.exports = {
  hash,
  compare,
};
